import{ getNewsList} from "../../api/news"



export function changeNewsList(list) {
    return {
        type:'changeNewsList',
        list
    }
}



//   redux 封装异步
export function initNewsList(pageNum, pageSize) {
    return function (dispath) {
        getNewsList(pageNum, pageSize).then(res => {
            dispath(changeNewsList(res.data.rows))
        })
    }
}